import * as types from "./actions-type";
export function djInfoDispatch(payload) {
  return {
    type: types.SET_DJINFO,
    payload
  };
}
export function playInfoDispatch(payload) {
  return {
    type: types.SET_PLAYINFO,
    payload
  };
}
export function canPlayListDispatch(payload) {
  return {
    type: types.SET_CANPLAYLIST,
    payload
  };
}
export function playPrivilegesDispatch(payload) {
  return {
    type: types.SET_PLAYPRIVILEGES,
    payload
  };
}
export function recommendListDispatch(payload) {
  return {
    type: types.SET_RECOMMENDLIST,
    payload
  };
}
export function recommendDjDispatch(payload) {
  return {
    type: types.SET_RECOMMENDDJ,
    payload
  };
}
export function recommendNewSongDispatch(payload) {
  return {
    type: types.SET_RECOMMENDNEWSONG,
    payload
  };
}
export function recommendDispatch(payload) {
  return {
    type: types.SET_RECOMMEND,
    payload
  };
}
export function myCreateListDispatch(payload) {
  return {
    type: types.SET_MYCREATELIST,
    payload
  };
}
export function myCollectListDispatch(payload) {
  return {
    type: types.SET_MYCOLLECTLIST,
    payload
  };
}
export function setCurrentsongid(payload) {
  return {
    type: types.SET_CURRENTSONGID,
    payload
  };
}
export function currentSongInfoDispatch(payload) {
  return {
    type: types.SET_CURRENTSONGINFO,
    payload
  };
}
export function setCurrentsongindex(payload) {
  return {
    type: types.SET_CURRENTSONGINDEX,
    payload
  };
}
export function playModeDispatch(payload) {
  return {
    type: types.SET_PLAYMODE,
    payload
  };
}
export function likeMusicListDispatch(payload) {
  return {
    type: types.SET_LIKEMUSICLIST,
    payload
  };
}
export function isPlayingDispatch(payload) {
  return {
    type: types.SET_ISPLAYING,
    payload
  };
}
export function recentTabDispatch(payload) {
  return {
    type: types.SET_RECENTTAB,
    payload
  };
}

// export function updateCanplayList(canPlayList, id) {
//   return (dispatch, getState) => {
//     let index = canPlayList.findIndex(item => item.id == id);
//     dispatch(setCanplaylist(canPlayList));
//     dispatch(setCurrentsongindex(index));
//   };
// }
// export function setSonginfo(info) {
//   return (dispatch, getState) => {
//     const { canPlayList } = getState();
//     let index = canPlayList.findIndex(item => item.id == info.id);
//     let temp = canPlayList.map((item, index) => {
//       item.current = false;
//       if (index === index) {
//         item.current = true;
//       }
//       return item;
//     });
//     dispatch(setCanplaylist(temp));
//     dispatch(setCurrentsonginfo(info));
//     dispatch(setCurrentsongindex(index));
//   };
// }
